from __future__ import absolute_import


import sys
import unittest 
from fenton.util import decamel

__test__ = False
__metaclass__ = type


TestCase = unittest.TestCase
class T(unittest.TestCase):
    __test__ = False
    def runTest(self):
        pass

def test(f):
    f.__name__ = 'test_' + f.__name__
    return f

test.__test__ = False

t = T()
for k in dir(t):
    if k.startswith('assert') or k.startswith('fail'):
        j = decamel(k[0].upper() + k[1:])
        if j != 'assert':
            exec k + " = t." + k
            exec decamel(k[0].upper() + k[1:]) + " = t." + k

def assert_is(first, second, msg=None):
    if not first is second:
        raise t.failureException, \
              (msg or '%r is not %r' % (first, second))

def assert_is_not(first, second, msg=None):
    if not first is second:
        raise t.failureException, \
              (msg or '%r is %r' % (first, second))

def assert_isinstance(first, second, msg=None):
    if not isinstance(first, second):
        raise t.failureException, \
                (msg or "%r is not instance of %r" % (first, second))


